From 18b0268f1960c4c6610b3548757edba8a89920db Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 20 Mar 2009 09:34:09 +0000 Subject: [PATCH] Do not pass DIRECTMAP_VIRT_END to virt_to_mfn(). It's out of range. Signed-off-by: Xiaowei Yang Signed-off-by: Keir Fraser --- xen/common/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index eb07404e7a..830e44cdb4 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -299,7 +299,7 @@ static unsigned long init_node_heap(int node, unsigned long mfn, } #ifdef DIRECTMAP_VIRT_END else if ( nr >= needed && - mfn + needed <= virt_to_mfn(DIRECTMAP_VIRT_END) ) + (mfn + needed) <= (virt_to_mfn(DIRECTMAP_VIRT_END - 1) + 1) ) { _heap[node] = mfn_to_virt(mfn); avail[node] = mfn_to_virt(mfn + needed) - sizeof(**avail) * NR_ZONES; -- 2.30.2